package com.service;

import com.dao.AdminDao;
import com.dao.impl.AdminDaoImpl;
import com.entity.Users;

import java.util.List;

public class AdminService {
    private AdminDao adminDao;

    private UsersService usersService;
    public AdminService(){
        this.adminDao=new AdminDaoImpl();
        this.usersService=new UsersService();
    }

    public Users login(String usename, String password) throws Exception {
//        Users users = new Users();
//        users.setUsername(usename);
//        users.setPwdHash(password);
//        users = usersService.add(users);
        Users users = adminDao.login(usename, password);
        return users;
    }
    public boolean deleteUserById(long id) throws Exception{
        boolean b = adminDao.deleteUserById(id);
        return b;
    }

    public Users selectUserById(int id) throws Exception{
        Users users = adminDao.selectUserById(id);
        return users;
    }
}
